package nl.utwente.csc.obsl.diagram.extension;


import nl.utwente.csc.obsl.diagram.extension.part.AbsentShapeEditPart;
import nl.utwente.csc.obsl.diagram.extension.part.KindShapeEditPart;
import nl.utwente.csc.obsl.diagram.extension.part.ModeShapeEditPart;
import nl.utwente.csc.obsl.diagram.extension.part.PhaseShapeEditPart;
import nl.utwente.csc.obsl.diagram.extension.part.QualityShapeEditPart;
import nl.utwente.csc.obsl.diagram.extension.part.RelatorShapeEditPart;
import nl.utwente.csc.obsl.diagram.extension.part.RoleShapeEditPart;
import nl.utwente.csc.obsl.diagram.extension.part.SubKindShapeEditPart;

import org.eclipse.gmf.runtime.diagram.ui.services.editpart.AbstractEditPartProvider;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.sirius.diagram.CustomStyle;

public class OBSLEditPartProvider extends AbstractEditPartProvider {
	
	private static final String kindID =    "OBSLKindStyle";
	private static final String subkindID = "OBSLSubKindStyle";
	private static final String phaseID =   "OBSLPhaseStyle";
	private static final String roleID =    "OBSLRoleStyle";
	private static final String relatorID = "OBSLRelatorStyle";
	private static final String modeID =    "OBSLModeStyle";
	private static final String qualityID = "OBSLQualityStyle";
	private static final String absentID =  "OBSLAbsentStyle";

	
	protected Class<?> getNodeEditPartClass(View view) {
	        if (view.getElement() instanceof CustomStyle) {
	            CustomStyle customStyle = (CustomStyle) view.getElement();
	            switch (customStyle.getId()) {
	            case kindID:      return KindShapeEditPart.class;
	            case subkindID:   return SubKindShapeEditPart.class;
	            case phaseID:     return PhaseShapeEditPart.class;
	            case roleID:      return RoleShapeEditPart.class;
	            case relatorID:   return RelatorShapeEditPart.class;
	            case modeID:      return ModeShapeEditPart.class;
	            case qualityID:   return QualityShapeEditPart.class;
	            case absentID:    return AbsentShapeEditPart.class;
	            default:
	            }
	        }
	        return super.getNodeEditPartClass(view);
	    }
}

		